/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package generalArchitecture.impl;

import generalArchitecture.ComputeBox;
import generalArchitecture.GeneralArchitecturePackage;
import generalArchitecture.Root;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Root</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link generalArchitecture.impl.RootImpl#getComputeBoxes <em>Compute Boxes</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RootImpl extends EObjectImpl implements Root {
	/**
	 * The cached value of the '{@link #getComputeBoxes() <em>Compute Boxes</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getComputeBoxes()
	 * @generated
	 * @ordered
	 */
	protected EList<ComputeBox> computeBoxes;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RootImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GeneralArchitecturePackage.Literals.ROOT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ComputeBox> getComputeBoxes() {
		if (computeBoxes == null) {
			computeBoxes = new EObjectContainmentEList<ComputeBox>(ComputeBox.class, this, GeneralArchitecturePackage.ROOT__COMPUTE_BOXES);
		}
		return computeBoxes;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case GeneralArchitecturePackage.ROOT__COMPUTE_BOXES:
				return ((InternalEList<?>)getComputeBoxes()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GeneralArchitecturePackage.ROOT__COMPUTE_BOXES:
				return getComputeBoxes();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GeneralArchitecturePackage.ROOT__COMPUTE_BOXES:
				getComputeBoxes().clear();
				getComputeBoxes().addAll((Collection<? extends ComputeBox>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GeneralArchitecturePackage.ROOT__COMPUTE_BOXES:
				getComputeBoxes().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GeneralArchitecturePackage.ROOT__COMPUTE_BOXES:
				return computeBoxes != null && !computeBoxes.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //RootImpl
